/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package commonpackage;

import java.util.Date;

/**
 *
 * @author chuda
 */
public class Order {

    private POI poi;
    private int orderid;
    private String telNumber = "";
    private Date dateMade;
    private Date resDate;



    public Date getDateMade() {
        return dateMade;
    }

    public void setDateMade(Date dateMade) {
        this.dateMade = dateMade;
    }

    public Date getResDate() {
        return resDate;
    }

    public void setResDate(Date resDate) {
        this.resDate = resDate;
    }
    private int numPeople = 1;
    private String nameOrderer;
    private int poiid;

    public Order() {
    }
    public Order(int poiid, String mobNum, int numPeople, String name, Date resDate) {
        this.poiid = poiid;
        this.telNumber = mobNum;
        this.numPeople = numPeople;
        this.nameOrderer = name;
        this.resDate = resDate;
    }
    public Order(POI poi, String telNumber, int numPeople, String name, Date resDate) {
        this.poi = poi;
        this.resDate = resDate;
        this.telNumber = telNumber;
        this.numPeople = numPeople;
        this.nameOrderer = name;
        this.dateMade = new Date();
        this.poiid = poi.getId();
    }
    public Order(POI poi, String telNumber, int numPeople, String name) {
        this.poi = poi;
        this.telNumber = telNumber;
        this.numPeople = numPeople;
        this.nameOrderer = name;
        this.dateMade = new Date();
        this.poiid = poi.getId();
    }
//    public Order(int poiid, String telNumber, int numPeople, String name){
//
//        this.telNumber = telNumber;
//        this.numPeople = numPeople;
//        this.nameOrderer = name;
//        this.date = new Date();
//    }

    /**
     * @return the poi
     */
    public POI getPoi() {
        return poi;
    }

    /**
     * @param poi the poi to set
     */
    public void setPoi(POI poi) {
        this.poi = poi;
    }

    /**
     * @return the telNumber
     */
    public String getTelNumber() {
        return telNumber;
    }

    /**
     * @param telNumber the telNumber to set
     */
    public void setTelNumber(String telNumber) {
        this.telNumber = telNumber;
    }

    /**
     * @return the date
     */
    public Date getDate() {
        return dateMade;
    }

    /**
     * @param date the date to set
     */
    public void setDate(Date date) {
        this.dateMade = date;
    }

    /**
     * @return the numPeople
     */
    public int getNumPeople() {
        return numPeople;
    }

    /**
     * @param numPeople the numPeople to set
     */
    public void setNumPeople(int numPeople) {
        this.numPeople = numPeople;
    }

    /**
     * @return the nameOrderer
     */
    public String getNameOrderer() {
        return nameOrderer;
    }

    /**
     * @param nameOrderer the nameOrderer to set
     */
    public void setNameOrderer(String nameOrderer) {
        this.nameOrderer = nameOrderer;
    }

    /**
     * @return the poiid
     */
    public int getPoiid() {
        return poiid;
    }

    /**
     * @param poiid the poiid to set
     */
    public void setPoiid(int poiid) {
        this.poiid = poiid;
    }

    /**
     * @return the orderid
     */
    public int getOrderid() {
        return orderid;
    }

    /**
     * @param orderid the orderid to set
     */
    public void setOrderid(int orderid) {
        this.orderid = orderid;
    }

    public String toStringX() {
        if(this.dateMade == null){
            this.dateMade = new Date();
        }
        /*this.poi = poi;
        this.telNumber = telNumber;
        this.numPeople = numPeople;
        this.nameOrderer = name;
        this.date = new Date();
        this.poiid = poi.getId();*/
        String ret = this.poiid + "#"+this.telNumber + "#" + this.numPeople + "#" +
                "" + this.nameOrderer + "#" + this.dateMade.getTime()+ "#" +
                ""+ this.resDate.getTime()+ "#" + this.poi.getName();
        return ret;
    }
}
